Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Using proxy_params was too heavy handed #50

Merged
merged 1 commit into from
Aug 1, 2023

Conversation

primdahl
Copy link
Collaborator

@primdahl primdahl commented Aug 1, 2023

The default nginx proxy_params directives clobber the LB upstream HTTP_X_FORWARDED_PROTO header by setting it to $scheme.

Instead, only set the Host header to overcome the implicit Host set by the proxy_pass directive, and rely on default behavior to pass on the remaining upstream headers from the LB.

Using $http_host rather than $host since the former is the client Host header and preserves the port number if present (tested to work both locally and behind LB).

The default nginx proxy_params directives clobber the LB upstream HTTP_X_FORWARDED_PROTO header by setting it to $scheme.

Instead, only set the Host header to overcome the implicit Host set by the proxy_pass directive, and rely on default behavior to pass on the remaining headers from the LB.

Using $http_host rather than $host since the former is the client Host header and preserves the port number if present. Tested with local docker instance and behind LB.
@rubys rubys merged commit ee3b7bf into fly-apps:main Aug 1, 2023
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants